package com.junzhiit.nengji.cms.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junzhiit.nengji.bo.ShopsLocatedIntegralBO;
import com.junzhiit.nengji.cms.service.ShopLocatedIntegralService;
import com.junzhiit.nengji.cms.web.util.ViewObjectUtil;
import com.junzhiit.nengji.cms.web.vo.DataTablesParamVO;
import com.junzhiit.nengji.cms.web.vo.ShopLocatedIntegralVO;
import com.junzhiit.nengji.dao.ShopsLocatedIntegralDAO;
import com.junzhiit.nengji.model.ShopsLocatedIntegral;

@Service
public class ShopLocatedIntegralServiceImpl extends BaseServiceImpl implements ShopLocatedIntegralService{

	@Autowired
	private ShopsLocatedIntegralDAO shopsLocatedIntegralDAO;
	
	@Override
	public Map<String, Object> findAll(ShopLocatedIntegralVO shopLocatedIntegralVO,DataTablesParamVO dtp){
		
		ShopsLocatedIntegral shopsLocatedIntegral=new ShopsLocatedIntegral();
		BeanUtils.copyProperties(shopLocatedIntegralVO, shopsLocatedIntegral);
		
		List<ShopsLocatedIntegralBO> list = shopsLocatedIntegralDAO.findAll(shopsLocatedIntegral,dtp.getStart(), dtp.getLength());
		int totalCount = shopsLocatedIntegralDAO.getTotalCount(shopsLocatedIntegral);
		return ViewObjectUtil.dataTables(list, dtp.getDraw(), totalCount);
	}
	
}
